home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue31 / construc / BOBSPDLG.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1998-02-06  |  1.1 KB  |  48 lines

  1. unit BobSpDlg;
  2. interface
  3. uses
  4.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  5.   StdCtrls, Buttons, ExtCtrls;
  6.  
  7. type
  8.   TAction = (None, Ignore, IgnoreAll, Replace, ReplaceAll, Add);
  9.  
  10. type
  11.   TFormBobSpell = class(TForm)
  12.     GroupBox1: TGroupBox;
  13.     Label1: TLabel;
  14.     EditFrom: TEdit;
  15.     EditTo: TEdit;
  16.     ListBoxSuggestions: TListBox;
  17.     ButtonIgnore: TButton;
  18.     ButtonReplace: TButton;
  19.     ButtonAddWord: TButton;
  20.     ButtonIgnoreAll: TButton;
  21.     ButtonReplaceAll: TButton;
  22.     BitBtnCancel: TBitBtn;
  23.     Image1: TImage;
  24.     procedure ListBoxSuggestionsClick(Sender: TObject);
  25.     procedure ButtonClick(Sender: TObject);
  26.   public
  27.     Action: TAction; { default = None }
  28.   end;
  29.  
  30. var
  31.   FormBobSpell: TFormBobSpell;
  32.  
  33. implementation
  34. {$R *.DFM}
  35.  
  36. procedure TFormBobSpell.ListBoxSuggestionsClick(Sender: TObject);
  37. begin
  38.   with ListBoxSuggestions do EditTo.Text := Items[ItemIndex]
  39. end;
  40.  
  41. procedure TFormBobSpell.ButtonClick(Sender: TObject);
  42. begin
  43.   Action := TAction((Sender AS TButton).Tag);
  44.   ModalResult := mrOk
  45. end;
  46.  
  47. end.
  48.